<!--show detail page create by pionner at Wed Dec 17 09:16:13 CST 2008-->
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
	<base href="<%=basePath%>">
		<title>UserBacterin</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
		<link rel='stylesheet' href='css/style.css'>
		<link rel='stylesheet' type='text/css' href='css/table.css'>
		<script src='js/alai_tree/Alai_tc.js'></script>
		<script src='js/Paginated.js'></script>
		<link rel="stylesheet" type="text/css" media="all" href="<%=path%>/js/calendar/calendar-win2k-cold-1.css" title="win2k-cold-1" />
	    <script type="text/javascript" src="<%=path%>/js/calendar/calendar.js"></script>
		<script type="text/javascript" src="<%=path%>/js/calendar/calendar-setup.js"></script>
		<script type="text/javascript" src="<%=path%>/js/calendar/calendar-zh1.js"></script>

	</head>
	<body>
	
		<table name="headtbl" id="headtbl" width='200' border='0' cellspacing='0' cellpadding='0'>
			<tr>
				<td width='90'><img src='images/loc-head.jpg' width='90' height='24'></td>
				<td valign='middle' nowrap background='images/loc-bg.jpg'><s:property value="message"/>疫苗接种信息   姓名：<s:property value="userName"/> 出生日期：<s:property value="birthday"/></td>
				<td width='12'><img src='images/loc-tail.jpg' width='12' height='24'></td>
			</tr>
		</table>
		<table>
				<tr><td colspan='100'>
						<table  width='100%' border='0' cellpadding='0' cellspacing='1' bgcolor='#336699'>
							<thead>
								<tr bgcolor='#88aaee'>
									<th></th>
									<th sque='0'>编号</th>
									
									<th sque='1'>疫苗名称</th>
									<th sque='1'>疫苗类别</th>
									<th sque='2'>预约时间</th>
									<th sque='3'>接种时间</th>
									
								</tr>
								</thead>
							<tbody id='table4'>
								<%int i=0; %>
								<s:iterator value='objects'>
									<form name="form<%=++i %>" action="userbacterinSave.action">
									<tr style=" width:100%; background-color:white" onMouseover="this.style.backgroundColor='#FFFFCC';" onMouseout="this.style.backgroundColor='white';">
										<td><s:hidden name="id" value="<s:property value='id'/>" /></td>
										<td><%=i %><s:hidden value="<s:property value='userId'/>"/></td>
										<td><s:property value='bacterinName'/></td>
										<td><s:property value='type'/></td>
										<td><s:property value='orderTimeS'/></td>
										<td><s:property value='injectTimeS'/></td>
									</tr>
									</form>
								</s:iterator>
							</tbody>
						</table>
						
					<table width='100%' border='0' cellpadding='0' cellspacing='1' bgcolor='#D4E5FA'>
							<tr>
								<td id='splidpagebnt2' align='right'>
									<input class="printbtn" name="printbtn" type="button" value="打印" onclick="printPage()">
								</td>
							</tr>
						</table>
					<form action="userbacterinSave.action" id="updatefrm" name="updatefrm" style="display: none">
							<input type="text" name="id" id="frmid" />
							<input type="text" name="injectTime" id="frmtime"/>
					</form>
				</td>
			</tr>
		</table>
	<object id="WebBrowser" width=0 height=0 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>
	</body>
</html>

<script type='text/javascript'>
function printHid(){
	document.all.headtbl.style.display='none';
	
	document.all.printbtn.style.display='none';
	
}
function afterprint(){
	document.all.headtbl.style.display='block';
	document.all.printbtn.style.display='block';
	
}


function printPage(){
	printHid()
	WebBrowser.ExecWB(6,1);
	 afterprint()
}
function setTimeComp(inputId){
	if(!document.getElementById(inputId)) return ;
	Calendar.setup(
		    {
		      inputField  : inputId,         // ID of the input field
		      ifFormat    : "%Y-%m-%d %H:%M:%S",    // the date format
		      //onSelect   : onSelect,
		      showsTime : true
		    }
		  );
}
function saveInjectTime(id,timeobj){
	
	//alert('id='+id+'        time='+document.getElementById(time).value);
	if(document.getElementById(timeobj).oldvalue){
		if(!window.confirm('确定要修改上次的接种时间？')){
			return false;
		
		}
	}
	var time=document.getElementById(timeobj).value
	
	if(!time)return false;
	
	document.getElementById('frmid').value=id;
	document.getElementById('frmtime').value=time;
	//alert(document.getElementById('updatefrm'));
	alert(document.getElementById('frmtime').value);
	document.getElementById('updatefrm').submit();
}
function afterBP(){
	var objs=document.getElementsByName('injectTime');
	if(objs){
		var obj=null;
		for(var i=0;i<objs.length;i++){
			obj=objs[i];
			if(obj.value){
				obj.oldvalue=obj.value;
			}
			try{
				if(document.getElementsByName('obj'+(i+1)))
					setTimeComp('obj'+(i+1));
			}catch(e){
				//alert(e.message);
			}
		}
	}
}
afterBP();
<!--
try{
	/**
	var table4ctrbtn2 =new PaginatedCtrl('table4','table4ctrbtn2');
	table4ctrbtn2.builder('splidpagebnt2');
	table4ctrbtn2.setShowCount(15);
	table4ctrbtn2.toPage(1);
	**/
}catch(e){
	alert(e.message);
}
function delsubmit(){
	document.all.listform.submit();
}
//-->
</script>

